package com.tsd.system.vo;

import me.chanjar.weixin.mp.config.impl.WxMpDefaultConfigImpl;

/**
 * @ClassName: MpSetting
 * @Description: TODO
 * @Author: Hillpool
 * @Date: 2022/7/6 16:04
 * @Version: 1.0
 */
public class MpSetting {

    public static final String SETTING_CODE_WX_MP = "wx_mp_setting";

    public String sys_setting_sid;

    /**
     * 公众号名称
     */
    private String wechat_name;

    /**
     * 公众号原始Id
     */
    private String wechat_gzh;

    /**
     * 公众号AppId
     */
    private String wechat_app_id;

    /**
     * 公众号AppSecret
     */
    private String wechat_app_secret;

    /**
     * 公众号Token
     */
    private String wechat_token;

    /**
     * 公众号EncodingAESKey
     */
    private String wechat_encoding_aes_key;

    public String getSys_setting_sid() {
        return sys_setting_sid;
    }

    public void setSys_setting_sid(String sys_setting_sid) {
        this.sys_setting_sid = sys_setting_sid;
    }

    public String getWechat_name() {
        return wechat_name;
    }

    public void setWechat_name(String wechat_name) {
        this.wechat_name = wechat_name;
    }

    public String getWechat_gzh() {
        return wechat_gzh;
    }

    public void setWechat_gzh(String wechat_gzh) {
        this.wechat_gzh = wechat_gzh;
    }

    public String getWechat_app_id() {
        return wechat_app_id;
    }

    public void setWechat_app_id(String wechat_app_id) {
        this.wechat_app_id = wechat_app_id;
    }

    public String getWechat_app_secret() {
        return wechat_app_secret;
    }

    public void setWechat_app_secret(String wechat_app_secret) {
        this.wechat_app_secret = wechat_app_secret;
    }

    public String getWechat_token() {
        return wechat_token;
    }

    public void setWechat_token(String wechat_token) {
        this.wechat_token = wechat_token;
    }

    public String getWechat_encoding_aes_key() {
        return wechat_encoding_aes_key;
    }

    public void setWechat_encoding_aes_key(String wechat_encoding_aes_key) {
        this.wechat_encoding_aes_key = wechat_encoding_aes_key;
    }

    public WxMpDefaultConfigImpl initWxMpConfig() {
        WxMpDefaultConfigImpl config = new WxMpDefaultConfigImpl();
        // 设置微信公众号的appid
        config.setAppId(this.getWechat_app_id());
        // 设置微信公众号的app corpSecret
        config.setSecret(this.getWechat_app_secret());
        // 设置微信公众号的token
        config.setToken(this.getWechat_token());
        // 设置微信公众号的EncodingAESKey
        config.setAesKey(this.getWechat_encoding_aes_key());
        return config;
    }
}
